<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<input id="line_id" name="lineId" type="hidden">
					<input id="line_name" name="lineName" type="hidden">
					<div class="select-list">
						<ul>

							<li>
								线路名称：<input type="text" name="name"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<!--<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true" lay-filter="10kvLine"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('assets:b10kvLineInfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('assets:b10kvLineInfo:remove')}]];
        var voltageGradeDatas = [[${@dict.getType('voltage_grade')}]];
        var prefix = ctx + "assets/b10kvLineInfo";

        $(function() {
            var options = {
                url: prefix + "/list",
                modalName: "10kv线路",
                showSearch:false,		//是否显示检索信息
                showRefresh:false,		//是否显示刷新按钮
                showToggle:false,		//是否显示详细视图和列表视图的切换按钮
                showColumns:false,		//是否显示隐藏某列下拉框
                sortable:false,		 	//是否启用排序
//                clickToSelect:true,		//点击选中后的事件【没暖用】
//		        showExport: true,
                columns: [{
		            radio: true
		        },
				{
					field : 'id', 
					title : '线路ID',
					visible: false
				},
                {
					field : 'name',
					title : '线路名称',
					sortable: true,
				},
				{
					field : 'pmsCode', 
					title : '营销编码',
					sortable: true
				},
				{
					field : 'gisCode', 
					title : 'gis编码',
					sortable: true
				},
				{
					field : 'voltage', 
					title : '电压等级',
					sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(voltageGradeDatas, value);
                    }
				},
				{
					field : 'unit', 
					title : '资产单位',
					sortable: true
				},
				{
					field : 'runTeam', 
					title : '运维班组',
					sortable: true
				},
				{
					field : 'addDate', 
					title : '创建日期',
					sortable: true,
					visible:false
				},
				{
					field : 'addUser', 
					title : '创建人',
					sortable: true,
					visible:false
				},
				{
					field : 'updateUser', 
					title : '最近更新人',
					sortable: true,
                    visible:false
				},
				{
					field : 'updateDate', 
					title : '最近更新日期',
					sortable: true,
                    visible:false
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            },
                    visible:false
		        }],
            };
            $.table.init(options);

            //单选框选择传值
			$("#bootstrap-table").on("check.bs.table", function (e, row, ele) {
				console.log("id和name=="+row.id+">>"+row.name)
				$("#line_id").val(row.id);
				$("#line_name").val(row.name);
			})
        });



    </script>
</body>
</html>